
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/**
 * 字符串分割函数
 */
int main(void){
     char str[] = "abc,def,ghi";
     char *t;
     rsize_t slmax =sizeof(str);
     char *pstr;

     t= strtok_s(str,",",&pstr);//abc
     printf("t=%s\n",t);
     t= strtok_s(NULL,",",&pstr);//def
     printf("t=%s\n",t);
     t= strtok_s(NULL,",",&pstr);//ghi
     printf("t=%s\n",t);

     
}
